package com.supplychainapi.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.joindata.inf.common.basic.exceptions.ServiceException;
import com.supplychainapi.dao.prod.ScmTbcustlvlMapper;
import com.supplychainapi.model.ScmTbcustlvl;
import com.supplychainapi.param.ColTitle;
import com.supplychainapi.service.IScmTbcustlvlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class ScmTbcustlvlServiceImpl implements IScmTbcustlvlService {
    @Autowired
    private ScmTbcustlvlMapper scmTbcustlvlMapper;


    @Override
    public PageInfo getTbcustpricelvlInfos(Integer pageNum, Integer pageSize) throws ServiceException {
        PageHelper.startPage(pageNum, pageSize);
        PageHelper.orderBy("fsCreateTime DESC");
        List<ScmTbcustlvl> list = scmTbcustlvlMapper.getTbcustpricelvlInfos();
        return new PageInfo(list);
    }


    @Override
    public List<ColTitle> getSchema() {
        List<ColTitle> list = new ArrayList<ColTitle>();
        list.add(new ColTitle("fsCustId", "选取", "center", 100));
        list.add(new ColTitle("fsCustLvlName", "客户评级名称", "center", 100));
        return list;
    }

}
